//----------------------------------------------------------------------------//
//                                                                            //
// ozz-animation is hosted at http://github.com/guillaumeblanc/ozz-animation  //
// and distributed under the MIT License (MIT).                               //
//                                                                            //
// Copyright (c) Guillaume Blanc                                              //
//                                                                            //
// Permission is hereby granted, free of charge, to any person obtaining a    //
// copy of this software and associated documentation files (the "Software"), //
// to deal in the Software without restriction, including without limitation  //
// the rights to use, copy, modify, merge, publish, distribute, sublicense,   //
// and/or sell copies of the Software, and to permit persons to whom the      //
// Software is furnished to do so, subject to the following conditions:       //
//                                                                            //
// The above copyright notice and this permission notice shall be included in //
// all copies or substantial portions of the Software.                        //
//                                                                            //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR //
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   //
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    //
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER //
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    //
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        //
// DEALINGS IN THE SOFTWARE.                                                  //
//                                                                            //
//----------------------------------------------------------------------------//

#ifndef OZZ_SAMPLES_FRAMEWORK_INTERNAL_ICOSPHERE_H_
#define OZZ_SAMPLES_FRAMEWORK_INTERNAL_ICOSPHERE_H_

#include "ozz/base/platform.h"

// Precomputed normalized icosphere with 2 levels of subdivisions.
// Note that kVertices can also be used as normals.
namespace icosphere {

static const float kVertices[] = {
    -0.682f, 0.717f,  0.148f,  -0.588f, 0.688f,  0.425f,  -0.443f, 0.864f,
    0.239f,  -0.526f, 0.851f,  0.000f,  -0.809f, 0.500f,  0.309f,  -0.309f,
    0.809f,  0.500f,  -0.717f, 0.148f,  0.682f,  -0.688f, 0.425f,  0.588f,
    -0.864f, 0.239f,  0.443f,  -0.851f, 0.000f,  0.526f,  -0.500f, 0.309f,
    0.809f,  -0.148f, 0.682f,  0.717f,  -0.425f, 0.588f,  0.688f,  -0.239f,
    0.443f,  0.864f,  0.000f,  0.526f,  0.851f,  -0.162f, 0.951f,  0.263f,
    -0.295f, 0.955f,  0.000f,  0.000f,  1.000f,  0.000f,  0.148f,  0.682f,
    0.717f,  0.000f,  0.851f,  0.526f,  0.309f,  0.809f,  0.500f,  0.295f,
    0.955f,  0.000f,  0.162f,  0.951f,  0.263f,  0.443f,  0.864f,  0.239f,
    0.526f,  0.851f,  0.000f,  -0.162f, 0.951f,  -0.263f, -0.443f, 0.864f,
    -0.239f, -0.309f, 0.809f,  -0.500f, 0.443f,  0.864f,  -0.239f, 0.162f,
    0.951f,  -0.263f, 0.309f,  0.809f,  -0.500f, -0.148f, 0.682f,  -0.717f,
    0.000f,  0.851f,  -0.526f, 0.148f,  0.682f,  -0.717f, 0.000f,  0.526f,
    -0.851f, -0.588f, 0.688f,  -0.425f, -0.682f, 0.717f,  -0.148f, -0.809f,
    0.500f,  -0.309f, -0.239f, 0.443f,  -0.864f, -0.425f, 0.588f,  -0.688f,
    -0.500f, 0.309f,  -0.809f, -0.864f, 0.239f,  -0.443f, -0.688f, 0.425f,
    -0.588f, -0.717f, 0.148f,  -0.682f, -0.851f, 0.000f,  -0.526f, -0.851f,
    0.526f,  0.000f,  -0.955f, 0.000f,  -0.295f, -0.951f, 0.263f,  -0.162f,
    -1.000f, 0.000f,  0.000f,  -0.951f, 0.263f,  0.162f,  -0.955f, 0.000f,
    0.295f,  0.588f,  0.688f,  0.425f,  0.682f,  0.717f,  0.148f,  0.809f,
    0.500f,  0.309f,  0.239f,  0.443f,  0.864f,  0.425f,  0.588f,  0.688f,
    0.500f,  0.309f,  0.809f,  0.864f,  0.239f,  0.443f,  0.688f,  0.425f,
    0.588f,  0.717f,  0.148f,  0.682f,  0.851f,  0.000f,  0.526f,  -0.263f,
    0.162f,  0.951f,  0.000f,  0.295f,  0.955f,  0.000f,  0.000f,  1.000f,
    -0.717f, -0.148f, 0.682f,  -0.526f, 0.000f,  0.851f,  -0.500f, -0.309f,
    0.809f,  0.000f,  -0.295f, 0.955f,  -0.263f, -0.162f, 0.951f,  -0.239f,
    -0.443f, 0.864f,  0.000f,  -0.526f, 0.851f,  -0.951f, -0.263f, 0.162f,
    -0.864f, -0.239f, 0.443f,  -0.809f, -0.500f, 0.309f,  -0.864f, -0.239f,
    -0.443f, -0.951f, -0.263f, -0.162f, -0.809f, -0.500f, -0.309f, -0.682f,
    -0.717f, 0.148f,  -0.851f, -0.526f, 0.000f,  -0.682f, -0.717f, -0.148f,
    -0.526f, -0.851f, 0.000f,  -0.526f, 0.000f,  -0.851f, -0.717f, -0.148f,
    -0.682f, -0.500f, -0.309f, -0.809f, 0.000f,  0.295f,  -0.955f, -0.263f,
    0.162f,  -0.951f, 0.000f,  0.000f,  -1.000f, -0.239f, -0.443f, -0.864f,
    -0.263f, -0.162f, -0.951f, 0.000f,  -0.295f, -0.955f, 0.000f,  -0.526f,
    -0.851f, 0.425f,  0.588f,  -0.688f, 0.239f,  0.443f,  -0.864f, 0.500f,
    0.309f,  -0.809f, 0.682f,  0.717f,  -0.148f, 0.588f,  0.688f,  -0.425f,
    0.809f,  0.500f,  -0.309f, 0.717f,  0.148f,  -0.682f, 0.688f,  0.425f,
    -0.588f, 0.864f,  0.239f,  -0.443f, 0.851f,  0.000f,  -0.526f, 0.682f,
    -0.717f, 0.148f,  0.588f,  -0.688f, 0.425f,  0.443f,  -0.864f, 0.239f,
    0.526f,  -0.851f, 0.000f,  0.809f,  -0.500f, 0.309f,  0.309f,  -0.809f,
    0.500f,  0.717f,  -0.148f, 0.682f,  0.688f,  -0.425f, 0.588f,  0.864f,
    -0.239f, 0.443f,  0.500f,  -0.309f, 0.809f,  0.148f,  -0.682f, 0.717f,
    0.425f,  -0.588f, 0.688f,  0.239f,  -0.443f, 0.864f,  0.162f,  -0.951f,
    0.263f,  0.295f,  -0.955f, 0.000f,  0.000f,  -1.000f, 0.000f,  -0.148f,
    -0.682f, 0.717f,  0.000f,  -0.851f, 0.526f,  -0.309f, -0.809f, 0.500f,
    -0.295f, -0.955f, 0.000f,  -0.162f, -0.951f, 0.263f,  -0.443f, -0.864f,
    0.239f,  0.162f,  -0.951f, -0.263f, 0.443f,  -0.864f, -0.239f, 0.309f,
    -0.809f, -0.500f, -0.443f, -0.864f, -0.239f, -0.162f, -0.951f, -0.263f,
    -0.309f, -0.809f, -0.500f, 0.148f,  -0.682f, -0.717f, 0.000f,  -0.851f,
    -0.526f, -0.148f, -0.682f, -0.717f, 0.588f,  -0.688f, -0.425f, 0.682f,
    -0.717f, -0.148f, 0.809f,  -0.500f, -0.309f, 0.239f,  -0.443f, -0.864f,
    0.425f,  -0.588f, -0.688f, 0.500f,  -0.309f, -0.809f, 0.864f,  -0.239f,
    -0.443f, 0.688f,  -0.425f, -0.588f, 0.717f,  -0.148f, -0.682f, 0.851f,
    -0.526f, 0.000f,  0.955f,  0.000f,  -0.295f, 0.951f,  -0.263f, -0.162f,
    1.000f,  0.000f,  0.000f,  0.951f,  -0.263f, 0.162f,  0.955f,  0.000f,
    0.295f,  0.263f,  -0.162f, 0.951f,  0.526f,  0.000f,  0.851f,  0.263f,
    0.162f,  0.951f,  -0.588f, -0.688f, 0.425f,  -0.425f, -0.588f, 0.688f,
    -0.688f, -0.425f, 0.588f,  -0.425f, -0.588f, -0.688f, -0.588f, -0.688f,
    -0.425f, -0.688f, -0.425f, -0.588f, 0.526f,  0.000f,  -0.851f, 0.263f,
    -0.162f, -0.951f, 0.263f,  0.162f,  -0.951f, 0.951f,  0.263f,  0.162f,
    0.951f,  0.263f,  -0.162f, 0.851f,  0.526f,  0.000f};

static const int kNumVertices = OZZ_ARRAY_SIZE(kVertices);

static const uint16_t kIndices[] = {
    3,   0,   2,   4,   1,   0,   5,   2,   1,   0,   1,   2,   9,   6,   8,
    10,  7,   6,   4,   8,   7,   6,   7,   8,   14,  11,  13,  5,   12,  11,
    10,  13,  12,  11,  12,  13,  4,   7,   1,   10,  12,  7,   5,   1,   12,
    7,   12,  1,   3,   2,   16,  5,   15,  2,   17,  16,  15,  2,   15,  16,
    14,  18,  11,  20,  19,  18,  5,   11,  19,  18,  19,  11,  24,  21,  23,
    17,  22,  21,  20,  23,  22,  21,  22,  23,  5,   19,  15,  20,  22,  19,
    17,  15,  22,  19,  22,  15,  3,   16,  26,  17,  25,  16,  27,  26,  25,
    16,  25,  26,  24,  28,  21,  30,  29,  28,  17,  21,  29,  28,  29,  21,
    34,  31,  33,  27,  32,  31,  30,  33,  32,  31,  32,  33,  17,  29,  25,
    30,  32,  29,  27,  25,  32,  29,  32,  25,  3,   26,  36,  27,  35,  26,
    37,  36,  35,  26,  35,  36,  34,  38,  31,  40,  39,  38,  27,  31,  39,
    38,  39,  31,  44,  41,  43,  37,  42,  41,  40,  43,  42,  41,  42,  43,
    27,  39,  35,  40,  42,  39,  37,  35,  42,  39,  42,  35,  3,   36,  0,
    37,  45,  36,  4,   0,   45,  36,  45,  0,   44,  46,  41,  48,  47,  46,
    37,  41,  47,  46,  47,  41,  9,   8,   50,  4,   49,  8,   48,  50,  49,
    8,   49,  50,  37,  47,  45,  48,  49,  47,  4,   45,  49,  47,  49,  45,
    24,  23,  52,  20,  51,  23,  53,  52,  51,  23,  51,  52,  14,  54,  18,
    56,  55,  54,  20,  18,  55,  54,  55,  18,  60,  57,  59,  53,  58,  57,
    56,  59,  58,  57,  58,  59,  20,  55,  51,  56,  58,  55,  53,  51,  58,
    55,  58,  51,  14,  13,  62,  10,  61,  13,  63,  62,  61,  13,  61,  62,
    9,   64,  6,   66,  65,  64,  10,  6,   65,  64,  65,  6,   70,  67,  69,
    63,  68,  67,  66,  69,  68,  67,  68,  69,  10,  65,  61,  66,  68,  65,
    63,  61,  68,  65,  68,  61,  9,   50,  72,  48,  71,  50,  73,  72,  71,
    50,  71,  72,  44,  74,  46,  76,  75,  74,  48,  46,  75,  74,  75,  46,
    80,  77,  79,  73,  78,  77,  76,  79,  78,  77,  78,  79,  48,  75,  71,
    76,  78,  75,  73,  71,  78,  75,  78,  71,  44,  43,  82,  40,  81,  43,
    83,  82,  81,  43,  81,  82,  34,  84,  38,  86,  85,  84,  40,  38,  85,
    84,  85,  38,  90,  87,  89,  83,  88,  87,  86,  89,  88,  87,  88,  89,
    40,  85,  81,  86,  88,  85,  83,  81,  88,  85,  88,  81,  34,  33,  92,
    30,  91,  33,  93,  92,  91,  33,  91,  92,  24,  94,  28,  96,  95,  94,
    30,  28,  95,  94,  95,  28,  100, 97,  99,  93,  98,  97,  96,  99,  98,
    97,  98,  99,  30,  95,  91,  96,  98,  95,  93,  91,  98,  95,  98,  91,
    104, 101, 103, 105, 102, 101, 106, 103, 102, 101, 102, 103, 60,  107, 109,
    110, 108, 107, 105, 109, 108, 107, 108, 109, 70,  111, 113, 106, 112, 111,
    110, 113, 112, 111, 112, 113, 105, 108, 102, 110, 112, 108, 106, 102, 112,
    108, 112, 102, 104, 103, 115, 106, 114, 103, 116, 115, 114, 103, 114, 115,
    70,  117, 111, 119, 118, 117, 106, 111, 118, 117, 118, 111, 80,  120, 122,
    116, 121, 120, 119, 122, 121, 120, 121, 122, 106, 118, 114, 119, 121, 118,
    116, 114, 121, 118, 121, 114, 104, 115, 124, 116, 123, 115, 125, 124, 123,
    115, 123, 124, 80,  126, 120, 128, 127, 126, 116, 120, 127, 126, 127, 120,
    90,  129, 131, 125, 130, 129, 128, 131, 130, 129, 130, 131, 116, 127, 123,
    128, 130, 127, 125, 123, 130, 127, 130, 123, 104, 124, 133, 125, 132, 124,
    134, 133, 132, 124, 132, 133, 90,  135, 129, 137, 136, 135, 125, 129, 136,
    135, 136, 129, 100, 138, 140, 134, 139, 138, 137, 140, 139, 138, 139, 140,
    125, 136, 132, 137, 139, 136, 134, 132, 139, 136, 139, 132, 104, 133, 101,
    134, 141, 133, 105, 101, 141, 133, 141, 101, 100, 142, 138, 144, 143, 142,
    134, 138, 143, 142, 143, 138, 60,  109, 146, 105, 145, 109, 144, 146, 145,
    109, 145, 146, 134, 143, 141, 144, 145, 143, 105, 141, 145, 143, 145, 141,
    70,  113, 67,  110, 147, 113, 63,  67,  147, 113, 147, 67,  60,  59,  107,
    56,  148, 59,  110, 107, 148, 59,  148, 107, 14,  62,  54,  63,  149, 62,
    56,  54,  149, 62,  149, 54,  110, 148, 147, 56,  149, 148, 63,  147, 149,
    148, 149, 147, 80,  122, 77,  119, 150, 122, 73,  77,  150, 122, 150, 77,
    70,  69,  117, 66,  151, 69,  119, 117, 151, 69,  151, 117, 9,   72,  64,
    73,  152, 72,  66,  64,  152, 72,  152, 64,  119, 151, 150, 66,  152, 151,
    73,  150, 152, 151, 152, 150, 90,  131, 87,  128, 153, 131, 83,  87,  153,
    131, 153, 87,  80,  79,  126, 76,  154, 79,  128, 126, 154, 79,  154, 126,
    44,  82,  74,  83,  155, 82,  76,  74,  155, 82,  155, 74,  128, 154, 153,
    76,  155, 154, 83,  153, 155, 154, 155, 153, 100, 140, 97,  137, 156, 140,
    93,  97,  156, 140, 156, 97,  90,  89,  135, 86,  157, 89,  137, 135, 157,
    89,  157, 135, 34,  92,  84,  93,  158, 92,  86,  84,  158, 92,  158, 84,
    137, 157, 156, 86,  158, 157, 93,  156, 158, 157, 158, 156, 60,  146, 57,
    144, 159, 146, 53,  57,  159, 146, 159, 57,  100, 99,  142, 96,  160, 99,
    144, 142, 160, 99,  160, 142, 24,  52,  94,  53,  161, 52,  96,  94,  161,
    52,  161, 94,  144, 160, 159, 96,  161, 160, 53,  159, 161, 160, 161, 159};

static const int kNumIndices = OZZ_ARRAY_SIZE(kIndices);

}  // namespace icosphere
#endif  // OZZ_SAMPLES_FRAMEWORK_INTERNAL_ICOSPHERE_H_
